﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LpnList.aspx.cs" EnableEventValidation="false" Inherits="WMS6.Web.Inventory.LpnList"
    meta:resourcekey="Page" %>

<%@ PreviousPageType VirtualPath="~/Inventory/LpnQuery.aspx" %>
<%@ Register Src="../UserControls/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>LpnList</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />

    <script src="../Js/jquery.js" type="text/javascript"></script>

    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>

    <script src="../Js/checkbox.js" type="text/javascript"></script>

    <script src="../Js/util.js" type="text/javascript"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <base target="_self" />

    <script type="text/javascript">
        //初始化页面
        window.onload = function(){            
            var action = document.getElementById("hdnActionID").value;
            if(action != null && action != "")
            {
                var array = action.split(',');
                initQueryPage(array[0],array[1]);
            }
            else
            {
                initListPage();            
                
            }
        }   
        
      
        function returnSearch()
        {
            var from = document.getElementById("hdnFrom").value;
            if(from != "")
            {
                window.location.href = "LpnQuery.aspx";
            }
            else
            {
                window.history.go(-1);
            }
        }
        
           //弹出 生成 LPN
        function popLpmSplit(LpnID)
        {
            var style =document.getElementById('mycss').href.split('/');
            var Action=style[style.length-3]+','+style[style.length-2];       
           if(LpnID !='')
           {         
                window.open('../Common/LpnSplit.aspx?ID=' + escape(LpnID)+'&ActionID='+Action, 'GenerateWindow', 'width=600,height=500,top=50,left=50,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no,status=no');
           }
        }

        //打印lpn标签
        function popPrinLpnLabel() 
        {
            var lpnIDs = document.getElementById("hdnLpnIDs").value;
            //window.open('../Common/PrintReport.aspx?rtype=PICKLPNLABEL&lpnIDS=' + escape(lpnIDs), 'PrintWindow', 'width=860,height=610,top=50,left=50,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no,status=no');
            window.open('../Common/PrintReport.aspx?rtype=PICKLPNLABEL', 'PrintWindow', 'width=860,height=610,top=50,left=50,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no,status=no');
        }
                
        function showAction()
		{	
			var pos = getElementPos("btnAction");	
			document.getElementById("actionDiv").style.top = pos.y+17;
			document.getElementById("actionDiv").style.left = pos.x;  			
			document.getElementById("hiddenFlag").value = '1';
		}
		
		    function hiddenDiv()
		{
			var flag = document.getElementById("hiddenFlag").value
			if(flag == "1")
			{
				document.getElementById("actionDiv").style.display = "block";
				document.getElementById("hiddenFlag").value = '0';
			}
			else 
			{
				document.getElementById("actionDiv").style.display = "none";
			}
		}
    </script>

</head>
<body>
    <form id="F5076" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_List_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblLpnList" runat="server" CssClass="label_header" Text="LPN列表" meta:resourcekey="lblLpnList"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnNew" runat="server" CssClass="button" Enabled="False" Text="<%$Resources:ButtonResource,btnNew%>" Visible="false"
                            OnClientClick="javascript:window.location.href='Lpn.aspx?from=list';return false;" />
                    </td>
                    <td>
                        <asp:Button ID="btnEdit" runat="server" CssClass="button" Enabled="False" Text="<%$Resources:ButtonResource,btnEdit%>"
                            OnClick="btnEdit_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnDelete" runat="server" CssClass="button" Enabled="False" Text="<%$Resources:ButtonResource,btnDelete%>" 
                            OnClientClick="javascript:if(confirm('是否删除该行项?'))return true; else return false;"
                            OnClick="btnDelete_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnRefresh" runat="server" CssClass="button" Enabled="False" Text="<%$Resources:ButtonResource,btnRefresh%>" />
                    </td>
                    <td>
                      <input id="btnAction" type="button" runat="server" value="<%$Resources:ButtonResource,btnAction%>" class="button"  onclick="showAction();" />       
                    </td>
                </tr>
            </table>
        </div>
        <div class="blank8">
        </div>
        <%--<asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>--%>
                <div id="div_List"> 
                    <div id="div_List_msg">
                        <asp:Label ID="lblMsg" runat="server" CssClass="label_message"></asp:Label>
                    </div>
                    <asp:GridView ID="gvLpn" runat="server" AutoGenerateColumns="False" AllowSorting="True"  oninit="gvLpn_Init"
                        OnSelectedIndexChanging="gvLpn_SelectedIndexChanging" OnRowDataBound="gvLpn_RowDataBound"
                        OnSorting="gvLpn_Sorting" CssClass="gridview" DataKeyNames="LPN_ID,Qty" PageSize="20"
                        Width="1000px" meta:resourcekey="gvLpn">
                        <FooterStyle CssClass="GridViewFooterStyle" />
                        <RowStyle CssClass="GridViewRowStyle" />
                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                        <Columns>
                            <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="BoundField">
                                <ItemStyle CssClass="GridViewRowWidth_40" />
                            </asp:BoundField>
                            <asp:TemplateField meta:resourcekey="TemplateFieldResource1">
                                <HeaderTemplate>
                                    <img src="../Images/gvSettingpic.gif" id="img01" class="gvSettingImg" onclick="gvUserSetting('5076','gvLpn');"
                                        onmouseover="showGVUserSettingAlt(this);" alt="customize list" />
                                    <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvLpn');"
                                        meta:resourcekey="CheckBox1Resource1" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chbSelect" runat="server" meta:resourcekey="chbSelectResource1" />
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvLpn');"
                                        meta:resourcekey="CheckBox2Resource1" />
                                </FooterTemplate>
                                <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                            </asp:TemplateField>
                            <asp:TemplateField ShowHeader="False" meta:resourcekey="TemplateField" Visible="false" >
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkbtnSelectOwner" runat="server" CausesValidation="False" CommandName="Select"
                                        Text="&lt;img src=&quot;../Images/select.gif&quot; class=&quot;img&quot; 
                                        style=&quot;border:none 0px blue;&quot; alt=&quot;select&quot; __designer:mapid=&quot;b3c&quot;/&gt;"
                                        meta:resourcekey="lnkbtnSelectOwner"></asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="LPN" FooterText="LPN" SortExpression="LPN_ID" meta:resourcekey="LPN_ID">
                                <ItemTemplate>
                                    <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("LPN_ID") %>' NavigateUrl='<%# FormatUrl("~/Inventory/Lpn.aspx?from=list&ID={0}",Eval("LPN_ID").ToString()) %>'
                                        Target="_self" CssClass="hyperlink" meta:resourcekey="HyperLink1Resource1"></asp:HyperLink>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_150" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="数量" HeaderText="数量" SortExpression="Qty" meta:resourcekey="Qty">
                                <ItemTemplate>
                                    <asp:Label ID="lblExpectedQty" runat="server" Text='<%# GetPreferenceDigit(Eval("Qty").ToString()) %>'
                                        meta:resourcekey="lblExpectedQty"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="STATUS" HeaderText="状态" FooterText="状态" SortExpression="STATUS"
                                meta:resourcekey="STATUS">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="PACK_ID" HeaderText="包装代码" FooterText="包装代码" SortExpression="PACK_ID"
                                meta:resourcekey="PACK_ID">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                             <asp:BoundField DataField="DOC_ID" HeaderText="单据号" FooterText="单据号" SortExpression="DOC_ID"
                                meta:resourcekey="DOC_ID">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                             <asp:BoundField DataField="DOC_TYPE" HeaderText="单据类型" FooterText="单据类型" SortExpression="DOC_TYPE"
                                meta:resourcekey="DOC_TYPE">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                             <asp:BoundField DataField="EXTERN_ID" HeaderText="外部订单号" FooterText="外部订单号" SortExpression="EXTERN_ID"
                                meta:resourcekey="EXTERN_ID">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="IS_ACTIVE" HeaderText="是否启用" FooterText="是否启用" SortExpression="IS_ACTIVE"
                                meta:resourcekey="IS_ACTIVE">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                        </Columns>
                    </asp:GridView>
                </div>
                <div id="div_pager">
                    <uc1:Pager ID="PagerFooter" runat="server" OnFirst="btnFirst_Click" OnPrevious="btnPrevious_Click"
                        OnNext="btnNext_Click" OnLast="btnLast_Click" OnGoTo="GoTo_Click" />
                </div>
                
          <%--  </ContentTemplate>
        </asp:UpdatePanel>--%>
        <div id="div_List_bottom">
            <table>
                <tr>
                    <td>
                        <asp:Button ID="btnSearch" runat="server" Text="<%$Resources:ButtonResource,btnNewSearch%>" CssClass="button" 
                            Enabled="False"  OnClick="btnSearch_Click"                           
                             />
                    </td>
                    <td>
                        <asp:Button ID="btnReSearch" runat="server" Text="<%$Resources:ButtonResource,btnReSearch%>" CssClass="button" Enabled="False" 
                            OnClientClick="javascript:returnSearch();return false;" 
                           />
                    </td>
                    <td>
                        <asp:Button ID="btnList" runat="server" Text="<%$Resources:ButtonResource,btnList%>" CssClass="button" Enabled="False" 
                            onclick="btnList_Click"  />
                    </td>
                    <td>
                        <asp:Button ID="btnExport" runat="server" Text="<%$Resources:ButtonResource,btnExport%>" CssClass="button" Enabled="False" 
                            onclick="btnExport_Click"   />
                    </td>
                </tr>
            </table>
        </div>
        <div id="actionDiv" style="background-color: #FFFFFF; position: absolute; display: none;">
            <table width="105" border="0" cellspacing="0" cellpadding="0" id="divcontent_menu2">
                <tr class="bg2" onmouseover="this.className='bg1'" onmouseout="this.className='bg2'">
                    <td class="line" id="tdlnkbtnLpnSplit" runat="server">
                        <asp:LinkButton ID="lnkbtnLpnSplit" runat="server" Text="LPN拆分" OnClick="lnkbtnLpnSplit_Click"></asp:LinkButton>
                    </td>
                </tr>
                <tr class="bg2" onmouseover="this.className='bg1'" onmouseout="this.className='bg2'">
                    <td class="line" id="tdlnkbtnPrintLpnLabel" runat="server">
                        <asp:LinkButton ID="lnkbtnPrintLpnLabel" runat="server" Text="打印LPN标签" OnClick="lnkbtnPrintLpnLabel_Click"></asp:LinkButton>
                    </td>
                </tr>
            </table>
        </div>  
    </div>
    <input type="hidden" id="hiddenFlag" />
    <input type="hidden" id="hdnFrom" runat="server" />
    <input type="hidden" id="hdnActionID" runat="server" />
    <input type="hidden" id="hdnRtnValue" runat="server" />
    <input type="hidden" id="hdnLpnIDs" runat="server" />
    </form>
</body>
</html>
<script language="javascript" type="text/javascript" event="onclick" for="document">
		<!--
			hiddenDiv();		 
		//-->
</script>